package cn.wjssl.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import cn.bugstack.middleware.db.router.annotation.DBRouterStrategy;
import cn.wjssl.infrastructure.persistent.po.RaffleActivityOrderPO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 抽奖活动单
 */
@Mapper
@DBRouterStrategy(splitTable = true)
public interface IRaffleActivityOrderDao {

    // 因为在事务中手动定义了数据库路由的key, 所以这里不再使用注解, 以确保是在一个数据库连接下完成的操作
    int insert(RaffleActivityOrderPO raffleActivityOrderPO);

    @DBRouter
    List<RaffleActivityOrderPO> queryRaffleActivityOrderByUserId(String userId);

    @DBRouter
    RaffleActivityOrderPO queryRaffleActivityOrder(RaffleActivityOrderPO raffleActivityOrderPO);

    int updateOrderCompleted(RaffleActivityOrderPO orderPORes);

}
